## 项目启动
import time

from crawler.connection import filter_push_redis, redis_conn, redis_shedana

info_list = [
    {'mens': [{
        "clothing": [
            {
                "Just in clothing": "https://www.theoutnet.com/en-hk/shop/mens/just-in/clothing",
                "Casual Shirts": "https://www.theoutnet.com/en-hk/shop/mens/clothing/casual-shirts",
                "Formal Shirts": "https://www.theoutnet.com/en-hk/shop/mens/clothing/formal-shirts",
                "Tops & T-Shirts": "https://www.theoutnet.com/en-hk/shop/mens/clothing/tops-t-shirts",
                "Coats": "https://www.theoutnet.com/en-hk/shop/mens/clothing/coats",
                "Jackets": "https://www.theoutnet.com/en-hk/shop/mens/clothing/jackets",
                "Casual Jackets": "https://www.theoutnet.com/en-hk/shop/mens/clothing/jackets/casual-jacket",
                "Leather Jackets": "https://www.theoutnet.com/en-hk/shop/mens/clothing/jackets/leather-jackets",
                "Blazers": "https://www.theoutnet.com/en-hk/shop/mens/clothing/jackets/blazers",
                "Knitwear": "https://www.theoutnet.com/en-hk/shop/mens/clothing/knitwear",
                "Cashmere": "https://www.theoutnet.com/en-hk/shop/mens/clothing?facet=ads_f31011_ntk_cs%3A%22Cashmere%22",
                "Crewneck Sweaters": "https://www.theoutnet.com/en-hk/shop/mens/clothing/knitwear/crew-neck-sweaters",
                "Pants": "https://www.theoutnet.com/en-hk/shop/mens/clothing/pants",
                "Jeans": "https://www.theoutnet.com/en-hk/shop/mens/clothing/jeans",
                "Shorts": "https://www.theoutnet.com/en-hk/shop/mens/clothing/shorts",
                "Suits": "https://www.theoutnet.com/en-hk/shop/mens/clothing/suits",
                "Swimwear": "https://www.theoutnet.com/en-hk/shop/mens/clothing/swimwear-beachwear",
                "Underwear & Sleepwear": "https://www.theoutnet.com/en-hk/shop/mens/clothing/underwear-sleepwear",
                "Sweats": "https://www.theoutnet.com/en-hk/shop/mens/clothing/sweats",
                "Smart Dressing": "https://www.theoutnet.com/en-hk/shop/mens/smart-dressing",
                "Wardrobe Staples": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations",
                "Luxury Streetwear": "https://www.theoutnet.com/en-hk/shop/mens/list/luxury-streetwear",
                "New Season": "https://www.theoutnet.com/en-hk/shop/mens/list/new-season",
                "Vacation Shop": "https://www.theoutnet.com/en-hk/shop/mens/list/the-summer-shop",
                "Loungewear": "https://www.theoutnet.com/en-hk/shop/mens/clothing/sweats",
                "Logo Tees": "https://www.theoutnet.com/en-hk/shop/mens/clothing/tops-t-shirts/logo-tops"
            }
        ],
        "Shoes": [
            {
                "Formal Shoes": "https://www.theoutnet.com/en-hk/shop/mens/shoes/formal-shoes",
                "Lace Up's": "https://www.theoutnet.com/en-hk/shop/mens/shoes/formal-shoes/lace-ups",
                "Loafers": "https://www.theoutnet.com/en-hk/shop/mens/shoes/formal-shoes/loafers",
                "Sneakers": "https://www.theoutnet.com/en-hk/shop/mens/shoes/sneakers",
                "Fashion Sneakers": "https://www.theoutnet.com/en-hk/shop/mens/shoes/sneakers/fashion",
                "Sport Sneakers": "https://www.theoutnet.com/en-hk/shop/mens/shoes/sneakers/sport",
                "Boots": "https://www.theoutnet.com/en-hk/shop/mens/shoes/boots",
                "Chelsea Boots": "https://www.theoutnet.com/en-hk/shop/mens/shoes/boots/chelsea",
                "Lace-up Boots": "https://www.theoutnet.com/en-hk/shop/mens/shoes/boots/lace-up"
            }
        ],
        "Bags": [
            {
                "Just in bags": "https://www.theoutnet.com/en-hk/shop/just-in/bags",
                "Backpacks": "https://www.theoutnet.com/en-hk/shop/bags/backpacks",
                "Clutch Bags": "https://www.theoutnet.com/en-hk/shop/bags/clutches",
                "Cross-Body Bags": "https://www.theoutnet.com/en-hk/shop/bags/shoulder-bags/cross-body",
                "Mini Bags": "https://www.theoutnet.com/en-hk/shop/bags/mini-bags",
                "Shoulder Bags": "https://www.theoutnet.com/en-hk/shop/bags/shoulder-bags",
                "Top-Handle Bags": "https://www.theoutnet.com/en-hk/shop/bags/top-handle-bags",
                "Tote Bags": "https://www.theoutnet.com/en-hk/shop/bags/tote-bags",
                "Alexander McQueen": "https://www.theoutnet.com/en-hk/shop/designers/alexander-mcqueen/bags",
                "By Far": "https://www.theoutnet.com/en-hk/shop/designers/by-far/bags",
                "Furla": "https://www.theoutnet.com/en-hk/shop/designers/furla",
                "Love Moschino": "https://www.theoutnet.com/en-hk/shop/designers/love-moschino/bags",
                "MICHAEL Michael Kors": "https://www.theoutnet.com/en-hk/shop/designers/michael-michael-kors/bags",
                "OFF-WHITE": "https://www.theoutnet.com/en-hk/shop/designers/off-white/bags",
                "See by Chloé": "",
                "Stand Studio": "https://www.theoutnet.com/en-hk/shop/designers/stand-studio/bags"
            }
        ],
        "Accessories": [
            {
                "All Gifts": "https://www.theoutnet.com/en-hk/shop/mens/list/all-gifts",
                "Gifts For Her": "https://www.theoutnet.com/en-hk/shop/list/all-gifts",
                "Belt Bags": "https://www.theoutnet.com/en-hk/shop/mens/accessories/bags/belt-bags",
                "Bags": "https://www.theoutnet.com/en-hk/shop/mens/accessories/bags",
                "Backpacks": "https://www.theoutnet.com/en-hk/shop/mens/accessories/bags/backpacks",
                "Luggage & Travel": "https://www.theoutnet.com/en-hk/shop/mens/accessories/bags/luggage-travel",
                "Messenger Bags": "https://www.theoutnet.com/en-hk/shop/mens/accessories/bags/messenger-bag",
                "Belts": "https://www.theoutnet.com/en-hk/shop/mens/accessories/belts",
                "Hats": "https://www.theoutnet.com/en-hk/shop/mens/accessories/hats",
                "Caps": "https://www.theoutnet.com/en-hk/shop/mens/accessories/hats/caps",
                "Scarves": "https://www.theoutnet.com/en-hk/shop/mens/accessories/scarves-ties/scarves",
                "Ties": "https://www.theoutnet.com/en-hk/shop/mens/accessories/scarves-ties/ties-pocket-squares",
                "Jewelry": "https://www.theoutnet.com/en-hk/shop/mens/accessories/jewelry",
                "Cufflinks & Tie Clips": "https://www.theoutnet.com/en-hk/shop/mens/accessories/jewelry/cufflinks-tie-clips",
                "Sunglasses": "https://www.theoutnet.com/en-hk/shop/mens/accessories/sunglasses",
                "Technology": "https://www.theoutnet.com/en-hk/shop/mens/accessories/technology"
            }
        ],
        "Sport": [
            {
                "Jackets": "https://www.theoutnet.com/en-hk/shop/mens/sport/jackets",
                "Pants": "https://www.theoutnet.com/en-hk/shop/mens/sport/pants",
                "Shorts": "https://www.theoutnet.com/en-hk/shop/mens/sport/shorts",
                "Skiwear": "https://www.theoutnet.com/en-hk/shop/mens/sport/skiwear",
                "Sneakers": "https://www.theoutnet.com/en-hk/shop/mens/shoes/sneakers",
                "Tops": "https://www.theoutnet.com/en-hk/shop/mens/sport/tops"
            }
        ],
        "The Foundations": [
            {
                "Accessories": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/accessories",
                "Casual Shirts": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/clothing/casual-shirts",
                "Tops & T-Shirts": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/clothing/tops-t-shirts",
                "Blazers": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/clothing/jackets/blazers",
                "Jackets": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/clothing/jackets",
                "Knitwear": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/clothing/knitwear",
                "Pants": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/clothing/pants",
                "Sneakers": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/shoes/sneakers",
                "Boots": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/shoes/boots",
                "Acne Studios": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/acne-studios",
                "Frame": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/frame",
                "James Perse": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/james-perse",
                "Nanuskha": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/nanushka",
                "Officine Générale": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/officine-generale",
                "Peserico": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/peserico-",
                "rag & bone": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/rag-bone",
                "Sandro": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/sandro",
                "Zegna": "https://www.theoutnet.com/en-hk/shop/mens/list/the-foundations/designers/zegna"
            }
        ]
    }]},
    {'women': [{
        "clothing": [
            {
                "Just in clothing": "https://www.theoutnet.com/en-hk/shop/just-in/clothing",
                "Beachwear": "https://www.theoutnet.com/en-hk/shop/beachwear",
                "Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses",
                "Cocktail & Party": "https://www.theoutnet.com/en-hk/shop/clothing/dresses/cocktail-and-party-dresses",
                "Knitwear": "https://www.theoutnet.com/en-hk/shop/clothing/knitwear",
                "Coats": "https://www.theoutnet.com/en-hk/shop/clothing/coats",
                "Jackets": "https://www.theoutnet.com/en-hk/shop/clothing/jackets",
                "Denim": "https://www.theoutnet.com/en-hk/shop/clothing/denim",
                "Jeans": "https://www.theoutnet.com/en-hk/shop/clothing/jeans",
                "Tops": "https://www.theoutnet.com/en-hk/shop/clothing/tops",
                "Pants": "https://www.theoutnet.com/en-hk/shop/clothing/pants",
                "Skirts": "https://www.theoutnet.com/en-hk/shop/clothing/skirts",
                "Leather": "https://www.theoutnet.com/en-hk/shop/clothing/leather",
                "Lingerie": "https://www.theoutnet.com/en-hk/shop/clothing/lingerie",
                "Activewear": "https://www.theoutnet.com/en-hk/shop/clothing/activewear",
                "Skiwear": "https://www.theoutnet.com/en-hk/shop/list/skiwear"
            }
        ],
        "Dresses": [
            {
                "Occasion Dresses": "https://www.theoutnet.com/en-hk/shop/list/the-occasion-edit/clothing/dresses",
                "Gowns": "https://www.theoutnet.com/en-hk/shop/clothing/dresses/gowns",
                "Mini Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses/mini-dresses",
                "Midi Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses/midi-dresses",
                "Maxi Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses/maxi-dresses",
                "Party Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses/cocktail-and-party-dresses",
                "Evening Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses?facet=ads_f31509_ntk_cs:%22Evening%22",
                "Bridal Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses?facet=ads_f31509_ntk_cs%3A%22Bridal%22",
                "Wedding Guest Dresses": "https://www.theoutnet.com/en-hk/shop/clothing/dresses?facet=ads_f31509_ntk_cs%3A%22Wedding+Guest%22",
                "ba&sh": "https://www.theoutnet.com/en-hk/shop/designers/bash/clothing/dresses",
                "Badgley Mischka  ": "https://www.theoutnet.com/en-hk/shop/designers/badgley-mischka/clothing/dresses",
                "Diane von Furstenberg": "https://www.theoutnet.com/en-hk/shop/designers/diane-von-furstenberg/clothing/dresses",
                "GANNI": "https://www.theoutnet.com/en-hk/shop/designers/ganni/clothing/dresses",
                "Marchesa Notte": "https://www.theoutnet.com/en-hk/shop/designers/marchesa-notte/clothing/dresses",
                "Mikael Aghal": "https://www.theoutnet.com/en-hk/shop/designers/mikael-aghal/clothing/dresses",
                "Nicholas": "https://www.theoutnet.com/en-hk/shop/designers/nicholas/clothing/dresses",
                "Sandro": "https://www.theoutnet.com/en-hk/shop/designers/sandro/clothing/dresses",
                "Valentino": "https://www.theoutnet.com/en-hk/shop/designers/valentino/clothing/dresses",
                "Zimmermann": "https://www.theoutnet.com/en-hk/shop/designers/zimmermann/clothing/dresses"
            }
        ],
        "Shoes": [
            {
                "Just in shoes": "https://www.theoutnet.com/en-hk/shop/just-in/shoes",
                "Boots": "https://www.theoutnet.com/en-hk/shop/shoes/boots",
                "Ankle Boots": "https://www.theoutnet.com/en-hk/shop/shoes/boots/ankle",
                "Knee-High Boots": "https://www.theoutnet.com/en-hk/shop/shoes/boots/knee-high",
                "Flat Shoes": "https://www.theoutnet.com/en-hk/shop/shoes/flat-shoes",
                "Heels": "https://www.theoutnet.com/en-hk/shop/shoes/heels",
                "Sneakers": "https://www.theoutnet.com/en-hk/shop/shoes/sneakers",
                "Gianvito Rossi": "https://www.theoutnet.com/en-hk/shop/designers/gianvito-rossi/shoes",
                "Giuseppe Zanotti": "https://www.theoutnet.com/en-hk/shop/designers/giuseppe-zanotti/shoes",
                "Jimmy Choo": "https://www.theoutnet.com/en-hk/shop/designers/jimmy-choo/shoes",
                "Roger Vivier": "https://www.theoutnet.com/en-hk/shop/designers/roger-vivier",
                "Salvatore Ferragamo": "https://www.theoutnet.com/en-hk/shop/designers/salvatore-ferragamo/shoes",
                "Sergio Rossi": "https://www.theoutnet.com/en-hk/shop/designers/sergio-rossi/shoes",
                "Stuart Weitzman": "https://www.theoutnet.com/en-hk/shop/designers/stuart-weitzman",
                "Tod's": "https://www.theoutnet.com/en-hk/shop/designers/tod-s/shoes",
                "Tory Burch": "https://www.theoutnet.com/en-hk/shop/designers/tod-s/shoes",
                "Valentino Garavani": "https://www.theoutnet.com/en-hk/shop/designers/valentino-garavani/shoes"
            }
        ],
        "Bags": [
            {
                "Just in bags": "https://www.theoutnet.com/en-hk/shop/just-in/bags",
                "Backpacks": "https://www.theoutnet.com/en-hk/shop/bags/backpacks",
                "Clutch Bags": "https://www.theoutnet.com/en-hk/shop/bags/clutches",
                "Cross-Body Bags": "https://www.theoutnet.com/en-hk/shop/bags/shoulder-bags/cross-body",
                "Mini Bags": "https://www.theoutnet.com/en-hk/shop/bags/mini-bags",
                "Shoulder Bags": "https://www.theoutnet.com/en-hk/shop/bags/shoulder-bags",
                "Top-Handle Bags": "https://www.theoutnet.com/en-hk/shop/bags/top-handle-bags",
                "Tote Bags": "https://www.theoutnet.com/en-hk/shop/bags/tote-bags",
                "Alexander McQueen": "https://www.theoutnet.com/en-hk/shop/designers/alexander-mcqueen/bags",
                "By Far": "https://www.theoutnet.com/en-hk/shop/designers/by-far/bags",
                "Furla": "https://www.theoutnet.com/en-hk/shop/designers/furla",
                "Love Moschino": "https://www.theoutnet.com/en-hk/shop/designers/love-moschino/bags",
                "MICHAEL Michael Kors": "https://www.theoutnet.com/en-hk/shop/designers/michael-michael-kors/bags",
                "OFF-WHITE": "https://www.theoutnet.com/en-hk/shop/designers/off-white/bags",
                "See by Chloé": "",
                "Stand Studio": "https://www.theoutnet.com/en-hk/shop/designers/stand-studio/bags"
            }
        ],
        "Accessories": [
            {
                "All Gifts": "https://www.theoutnet.com/en-hk/shop/list/all-gifts",
                "Gifts for Him": "https://www.theoutnet.com/en-hk/shop/mens/list/all-gifts",
                "Belts": "https://www.theoutnet.com/en-hk/shop/accessories/belts",
                "Earrings": "https://www.theoutnet.com/en-hk/shop/accessories/jewelry/earrings",
                "Hats": "https://www.theoutnet.com/en-hk/shop/accessories/hats",
                "Jewelry": "https://www.theoutnet.com/en-hk/shop/accessories/jewelry",
                "Scarves": "https://www.theoutnet.com/en-hk/shop/accessories/scarves",
                "Wallets": "https://www.theoutnet.com/en-hk/shop/accessories/wallets",
                "Ben-Amun": "https://www.theoutnet.com/en-hk/shop/designers/ben-amun/accessories",
                "Brunello Cucinelli": "https://www.theoutnet.com/en-hk/shop/designers/brunello-cucinelli/accessories",
                "Chloé": "https://www.theoutnet.com/en-hk/shop/designers/chloe/accessories",
                "Dolce & Gabbana": "https://www.theoutnet.com/en-hk/shop/superbrands/designers/dolce-gabbana",
                "Givenchy": "https://www.theoutnet.com/en-hk/shop/designers/givenchy/accessories  ",
                "Kenneth Jay Lane": "https://www.theoutnet.com/en-hk/shop/designers/kenneth-jay-lane",
                "Loro Piana": "https://www.theoutnet.com/en-hk/shop/designers/loro-piana/accessories",
                "Missoma": "https://www.theoutnet.com/en-hk/shop/designers/missoma/accessories",
                "Valentino Garavani": "https://www.theoutnet.com/en-hk/shop/designers/valentino-garavani/accessories"
            }
        ]
    }

    ]}
]
url_list = list()
for info in info_list:
    for k, v in info.items():
        for key, value in v[0].items():
            for d, b in value[0].items():
                info_dict = dict()
                info_dict['sex'] = k
                info_dict['category'] = key + '>>' + d
                info_dict['url'] = b
                url_list.append(info_dict)

for index, url_info in enumerate(url_list):
    task = {
        "jobId": index,
        'info': url_info,
        'domain': 'theoutnet'.upper(),
        'filename': 'main',
        'types': 'electronic_business',
        "scheduleTime": int(time.time() * 1000),
        "triggerChannel": 'SONIC_SPIDER',
    }
    # result = filter_push_redis(redis_shedana, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    result = filter_push_redis(redis_conn, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    print(result)
    # input()
